<template>
  <div class="member-home">
      <!-- 概览 -->
      <MemberHomeOverview />
      <!-- 收藏 -->
      <MemberHomePanel title="我的收藏">
        <GoodsItem v-for="item in collectGoods" :key="item.id" :goods="item" />
      </MemberHomePanel>
      <!-- 足迹 -->
      <MemberHomePanel title="我的足迹">
        <GoodsItem v-for="i in 4" :key="i" :goods="goods" />
      </MemberHomePanel>
      <!-- 猜你喜欢 -->
      <GoodsRelevant />
  </div>
</template>
<script>
import MemberHomeOverview from './components/home-overview.vue'
import MemberHomePanel from './components/home-panel.vue'
import GoodsRelevant from '@/views/goods/components/goods-relevant.vue'
import GoodsItem from '@/views/category/components/goods-item.vue'
import { findCollect } from '@/api/member'
import { ref } from 'vue'
export default {
  name: 'MemberHome',
  components: {
    MemberHomeOverview,
    MemberHomePanel,
    GoodsRelevant,
    GoodsItem
  },
  setup () {
    // 调用模拟接口
    const collectGoods = ref([])
    findCollect({
      page: 1,
      pageSize: 4
    }).then(data => {
      collectGoods.value = data.result.items
    })

    return { collectGoods }
  }
}
</script>
<style scoped lang="less">
:deep(.xtx-carousel) .carousel-btn.prev {
  left: 5px;
}
:deep(.xtx-carousel) .carousel-btn.next {
  right: 5px;
}
</style>
